<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,java.util.Random"%>
<%String userid=request.getParameter("userid");%>

<HEAD>


	<script LANGUAGE="Javascript" SRC="Images/validate.js"></script>
	<script LANGUAGE="Javascript">
		function fnShowDetails(InterviewID,U)
			{
				var URL = U+"?InterviewID="+InterviewID;
				fnEmpPopUp(URL,600,600);
			}
	</script>


	<LINK href="styles.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY class=Grad>
<h2 align=center>My Applications</h2>
<p align=center>&nbsp;</p>
<table align="center" width="60%">
<p align=left><b><font face="Verdana" size="2" color="#FF00FF">Dear </font>
<font face="Verdana" size="2" color="#008000"> <u><%=userid%></u></font><font face="Verdana" size="2" color="#FF00FF">, your applied jobs </font></b></p>
<%

	Connection con=null;
	ResultSet rs=null;
	Statement stmt=null;
	try{
			
			/* Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			con = DriverManager.getConnection("jdbc:odbc:JobPortal","root",""); */

			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jobmiller","root","root");

			stmt =  con.createStatement();
			String Query = "Select * from Applicationdetails where userid='"+userid+"'";
			System.out.println("--->"+Query);
			rs = stmt.executeQuery(Query);
			%>
	
					<%
			int rCount=0;
			while(rs.next())
			{
				String InterviewID= rs.getString(3);
					%>
					<tr class=row_odd width='50%'>
								<th align="left" width="17%">Job ID</th>
								<td width="81%"><A onclick="fnShowDetails('<%=InterviewID%>','ShowAppliedJobs.jsp')"><B>&lt;&lt;<%=InterviewID%>&gt;&gt;</B></td>
					</tr>
					<tr class=row_odd>								
								<th align="left" width="17%">Applied on</th>
								<td width="81%"><%=rs.getString(4)%></td>
					</tr>
					<tr class=row_odd>								
								<th align="left" width="17%">Status</th>
								<td width="81%"><%=rs.getString(5)%></td>
					</tr>
					<tr class=row_odd>	
								<th align="left" colspan=2><hr color='FF3399'></th>
					</tr>
					<%
				rCount++;
			}
			if( rCount == 0)	{%><tr class=row_odd><th  colspan=2><b>No active applications</b></th></tr><% }
			rs.close();
			stmt.close();
			con.close();
		}catch(Exception e){
			rs.close();
			stmt.close();
			con.close();
			%><%=e%><%
		}
	
%>
<font face="Times New Roman" size="2" color="#808080">
<b>Note:</b><i>Click on job id to view details</i></font>
</table>
</BODY>

</PRE>